<html>
<head><meta charset="utf-8"><title>cargo doc for std in rust-src component · rustdoc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/index.html">rustdoc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html">cargo doc for std in rust-src component</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="222736801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222736801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222736801">(Jan 14 2021 at 15:54)</a>:</h4>
<p>What should I do to make <code>cargo doc</code> successfully run on std of rust-src component of rustup ?<br>
I've had these errors so far:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">    </span><span class="n">Checking</span><span class="w"> </span><span class="n">rustc</span><span class="o">-</span><span class="n">std</span><span class="o">-</span><span class="n">workspace</span><span class="o">-</span><span class="n">alloc</span><span class="w"> </span><span class="n">v1</span><span class="p">.</span><span class="mf">0.0</span><span class="w"></span>
<span class="w"> </span><span class="n">Documenting</span><span class="w"> </span><span class="n">rustc</span><span class="o">-</span><span class="n">std</span><span class="o">-</span><span class="n">workspace</span><span class="o">-</span><span class="n">alloc</span><span class="w"> </span><span class="n">v1</span><span class="p">.</span><span class="mf">0.0</span><span class="w"></span>
<span class="n">error</span><span class="p">[</span><span class="n">E0433</span><span class="p">]</span>: <span class="nc">failed</span><span class="w"> </span><span class="n">to</span><span class="w"> </span><span class="n">resolve</span>: <span class="nc">could</span><span class="w"> </span><span class="n">not</span><span class="w"> </span><span class="n">find</span><span class="w"> </span><span class="err">`</span><span class="n">prelude</span><span class="err">`</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="err">`</span><span class="n">core</span><span class="err">`</span><span class="w"></span>

<span class="n">error</span><span class="p">[</span><span class="n">E0432</span><span class="p">]</span>: <span class="nc">unresolved</span><span class="w"> </span><span class="n">import</span><span class="w"> </span><span class="err">`</span><span class="n">core</span>::<span class="n">ops</span><span class="err">`</span><span class="w"></span>
<span class="w"> </span><span class="o">-</span>-&gt; <span class="o">/</span><span class="n">home</span><span class="o">/</span><span class="n">lzutao</span><span class="o">/</span><span class="p">.</span><span class="n">cargo</span><span class="o">/</span><span class="n">registry</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">github</span><span class="p">.</span><span class="n">com</span><span class="o">-</span><span class="mi">1</span><span class="n">ecc6299db9ec823</span><span class="o">/</span><span class="n">compiler_builtins</span><span class="o">-</span><span class="mf">0.1.39</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">float</span><span class="o">/</span><span class="k">mod</span><span class="p">.</span><span class="n">rs</span>:<span class="mi">1</span>:<span class="mi">5</span><span class="w"></span>
<span class="w">  </span><span class="o">|</span><span class="w"></span>
<span class="mi">1</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">use</span><span class="w"> </span><span class="n">core</span>::<span class="n">ops</span><span class="p">;</span><span class="w"></span>
<span class="w">  </span><span class="o">|</span><span class="w">     </span><span class="o">^^^^^^^^^</span><span class="w"> </span><span class="n">no</span><span class="w"> </span><span class="err">`</span><span class="n">ops</span><span class="err">`</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">root</span><span class="w"></span>

<span class="n">error</span><span class="p">[</span><span class="n">E0432</span><span class="p">]</span>: <span class="nc">unresolved</span><span class="w"> </span><span class="n">import</span><span class="w"> </span><span class="err">`</span><span class="n">core</span>::<span class="n">ops</span><span class="err">`</span><span class="w"></span>
<span class="w"> </span><span class="o">-</span>-&gt; <span class="o">/</span><span class="n">home</span><span class="o">/</span><span class="n">lzutao</span><span class="o">/</span><span class="p">.</span><span class="n">cargo</span><span class="o">/</span><span class="n">registry</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">github</span><span class="p">.</span><span class="n">com</span><span class="o">-</span><span class="mi">1</span><span class="n">ecc6299db9ec823</span><span class="o">/</span><span class="n">compiler_builtins</span><span class="o">-</span><span class="mf">0.1.39</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">int</span><span class="o">/</span><span class="k">mod</span><span class="p">.</span><span class="n">rs</span>:<span class="mi">1</span>:<span class="mi">5</span><span class="w"></span>
<span class="w">  </span><span class="o">|</span><span class="w"></span>
<span class="mi">1</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">use</span><span class="w"> </span><span class="n">core</span>::<span class="n">ops</span><span class="p">;</span><span class="w"></span>
<span class="w">  </span><span class="o">|</span><span class="w">     </span><span class="o">^^^^^^^^^</span><span class="w"> </span><span class="n">no</span><span class="w"> </span><span class="err">`</span><span class="n">ops</span><span class="err">`</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">root</span><span class="w"></span>

<span class="n">error</span><span class="p">[</span><span class="n">E0432</span><span class="p">]</span>: <span class="nc">unresolved</span><span class="w"> </span><span class="n">import</span><span class="w"> </span><span class="err">`</span><span class="n">core</span>::<span class="n">intrinsics</span><span class="err">`</span><span class="w"></span>
<span class="w"> </span><span class="o">-</span>-&gt; <span class="o">/</span><span class="n">home</span><span class="o">/</span><span class="n">lzutao</span><span class="o">/</span><span class="p">.</span><span class="n">cargo</span><span class="o">/</span><span class="n">registry</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">github</span><span class="p">.</span><span class="n">com</span><span class="o">-</span><span class="mi">1</span><span class="n">ecc6299db9ec823</span><span class="o">/</span><span class="n">compiler_builtins</span><span class="o">-</span><span class="mf">0.1.39</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">mem</span><span class="o">/</span><span class="k">mod</span><span class="p">.</span><span class="n">rs</span>:<span class="mi">8</span>:<span class="mi">11</span><span class="w"></span>
<span class="w">  </span><span class="o">|</span><span class="w"></span>
<span class="mi">8</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">use</span><span class="w"> </span><span class="n">core</span>::<span class="n">intrinsics</span>::<span class="p">{</span><span class="n">atomic_load_unordered</span><span class="p">,</span><span class="w"> </span><span class="n">atomic_store_unordered</span><span class="p">,</span><span class="w"> </span><span class="n">exact_div</span><span class="p">};</span><span class="w"></span>
<span class="w">  </span><span class="o">|</span><span class="w">           </span><span class="o">^^^^^^^^^^</span><span class="w"> </span><span class="n">could</span><span class="w"> </span><span class="n">not</span><span class="w"> </span><span class="n">find</span><span class="w"> </span><span class="err">`</span><span class="n">intrinsics</span><span class="err">`</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="err">`</span><span class="n">core</span><span class="err">`</span><span class="w"></span>
</code></pre></div>



<a name="222737047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222737047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222737047">(Jan 14 2021 at 15:55)</a>:</h4>
<p><span class="user-mention" data-user-id="209117">@lzutao</span> I would be suprised if you can get that to work</p>



<a name="222737076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222737076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222737076">(Jan 14 2021 at 15:56)</a>:</h4>
<p>to be more clear: I cd to std in rust-src:</p>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code><span class="nb">cd</span> /home/lzutao/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std
</code></pre></div>



<a name="222737141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222737141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222737141">(Jan 14 2021 at 15:56)</a>:</h4>
<p>use <code>x.py doc</code> instead, or use the distributed <code>rust-docs</code></p>



<a name="222737180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222737180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222737180">(Jan 14 2021 at 15:56)</a>:</h4>
<p>it <em>may</em> work from <code>library/test</code> but no guarantee</p>



<a name="222738348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222738348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222738348">(Jan 14 2021 at 16:03)</a>:</h4>
<p>./x.py doc sure will works. However I intend to run the script on CI.<br>
./x.py seems really heavy weight. As everytime the CI needs to clone every submodules of rust, including llvm.<br>
That is really time consuming.</p>
<p>There is <a href="https://github.com/rust-lang/rust/blob/7bb163095d8c751787f1449f3f3c245077f484e3/src/bootstrap/doc.rs#L408">https://github.com/rust-lang/rust/blob/7bb163095d8c751787f1449f3f3c245077f484e3/src/bootstrap/doc.rs#L408</a>, but I don't understand the code yet.</p>



<a name="222738510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222738510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222738510">(Jan 14 2021 at 16:04)</a>:</h4>
<p>did you try from <code>library/test</code>?</p>



<a name="222738528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222738528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222738528">(Jan 14 2021 at 16:04)</a>:</h4>
<p>why are you running this on CI?</p>



<a name="222739264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222739264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222739264">(Jan 14 2021 at 16:09)</a>:</h4>
<p><span class="user-mention" data-user-id="209117">@lzutao</span> ^</p>



<a name="222740244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222740244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222740244">(Jan 14 2021 at 16:16)</a>:</h4>
<p>No, I have not run in test yet.</p>
<p>What I want to do is generating std internal doc for personal use. Three is a similar project <a href="http://stddr.rs">stddr.rs</a> ( I may not remember correctly), but I find their site is slow to access in my location.</p>



<a name="222740548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222740548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222740548">(Jan 14 2021 at 16:17)</a>:</h4>
<p>Maybe because they use server of Google cloud located far from my area.</p>



<a name="222741047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222741047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222741047">(Jan 14 2021 at 16:19)</a>:</h4>
<p>why do you specifically want to generate it? it's available from the <code>rust-docs</code> component</p>



<a name="222741355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222741355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222741355">(Jan 14 2021 at 16:22)</a>:</h4>
<p>To browse whever functions in std do Internally. Rust-docs component only covers public API.</p>



<a name="222741416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222741416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222741416">(Jan 14 2021 at 16:22)</a>:</h4>
<p>ah ok, that makes sense</p>



<a name="222741447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222741447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222741447">(Jan 14 2021 at 16:22)</a>:</h4>
<p>try <code>library/test</code>, I think it will work</p>



<a name="222741500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222741500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222741500">(Jan 14 2021 at 16:22)</a>:</h4>
<p>Thanks, I will try tomorrow.</p>



<a name="222806387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/cargo%20doc%20for%20std%20in%20rust-src%20component/near/222806387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/cargo.20doc.20for.20std.20in.20rust-src.20component.html#222806387">(Jan 15 2021 at 00:52)</a>:</h4>
<p>cargo doc failed on <code>library/test</code>.<br>
I am wondering how <code>-Z build-std</code> flag of cargo works. Can we do the same to make cargo doc works on std ?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>